import request from '@/utils/request'

let baseUrl = process.env.NODE_ENV === 'production' ? 'api/core' : '/core'

export const getContractTemplates = (data: any) =>
  request({
    baseURL: baseUrl,
    url: '/contract/template/query',
    method: 'post',
    data
  })

export const addTemplate = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/contract/template/add',
    method: 'post',
    data
  })

export const getTemplate = (data: number) =>
  request({
    baseURL: baseUrl,
    url: '/contract/template/' + data,
    method: 'get'
  })

export const updateTemplate = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/contract/template/update',
    method: 'post',
    data
  })

export const getContracts = (data: any) =>
  request({
    baseURL: baseUrl,
    url: '/contract/query',
    method: 'post',
    data
  })
